package com.wpp.test;

public class  Consumer extends Thread{

    private Clerk clerk;

    public Consumer(Clerk clerk){
        this.clerk=clerk;
    }

    @Override
    public void run() {
        System.out.println(Thread.currentThread().getName()+"---------------开始消费产品-------------------");
        while (true){

            try {
                sleep(200);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            clerk.consumeProduct();


        }

    }
}
